package com.caishi.lkx.exam.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.caishi.lkx.exam.ienum.type.PkType;
import com.caishi.lkx.exam.model.PkRoom;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface PkRoomMapper extends BaseMapper<PkRoom> {
    PkRoom getPkRoom(Integer id);
    PkRoom getPkRoomOne(@Param("userId") String userId, @Param("examId") String examId, @Param("type") PkType type);
    List<PkRoom> getPkRooms();
    @Delete("delete from pk_room where id = #{id}")
    Integer deleteById(@Param("id") Integer id);
    @Select("select count(*) from pk_room where exam_id=#{examId} and (person1 = #{userId} or person2 = #{userId})")
    Integer getMyCount(@Param("userId") String userId, @Param("examId") String examId);

}
